﻿using System;
using UnityEngine;

namespace UniRx.Triggers
{
	// Token: 0x02000436 RID: 1078
	[DisallowMultipleComponent]
	public class ObservableMouseTrigger : ObservableTriggerBase
	{
		// Token: 0x0600169D RID: 5789 RVA: 0x00062014 File Offset: 0x00060414
		private void OnMouseDown()
		{
			if (this.onMouseDown != null)
			{
				this.onMouseDown.OnNext(Unit.Default);
			}
		}

		// Token: 0x0600169E RID: 5790 RVA: 0x00062034 File Offset: 0x00060434
		public IObservable<Unit> OnMouseDownAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.onMouseDown) == null)
			{
				result = (this.onMouseDown = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x0600169F RID: 5791 RVA: 0x0006205C File Offset: 0x0006045C
		private void OnMouseDrag()
		{
			if (this.onMouseDrag != null)
			{
				this.onMouseDrag.OnNext(Unit.Default);
			}
		}

		// Token: 0x060016A0 RID: 5792 RVA: 0x0006207C File Offset: 0x0006047C
		public IObservable<Unit> OnMouseDragAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.onMouseDrag) == null)
			{
				result = (this.onMouseDrag = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x060016A1 RID: 5793 RVA: 0x000620A4 File Offset: 0x000604A4
		private void OnMouseEnter()
		{
			if (this.onMouseEnter != null)
			{
				this.onMouseEnter.OnNext(Unit.Default);
			}
		}

		// Token: 0x060016A2 RID: 5794 RVA: 0x000620C4 File Offset: 0x000604C4
		public IObservable<Unit> OnMouseEnterAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.onMouseEnter) == null)
			{
				result = (this.onMouseEnter = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x060016A3 RID: 5795 RVA: 0x000620EC File Offset: 0x000604EC
		private void OnMouseExit()
		{
			if (this.onMouseExit != null)
			{
				this.onMouseExit.OnNext(Unit.Default);
			}
		}

		// Token: 0x060016A4 RID: 5796 RVA: 0x0006210C File Offset: 0x0006050C
		public IObservable<Unit> OnMouseExitAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.onMouseExit) == null)
			{
				result = (this.onMouseExit = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x060016A5 RID: 5797 RVA: 0x00062134 File Offset: 0x00060534
		private void OnMouseOver()
		{
			if (this.onMouseOver != null)
			{
				this.onMouseOver.OnNext(Unit.Default);
			}
		}

		// Token: 0x060016A6 RID: 5798 RVA: 0x00062154 File Offset: 0x00060554
		public IObservable<Unit> OnMouseOverAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.onMouseOver) == null)
			{
				result = (this.onMouseOver = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x060016A7 RID: 5799 RVA: 0x0006217C File Offset: 0x0006057C
		private void OnMouseUp()
		{
			if (this.onMouseUp != null)
			{
				this.onMouseUp.OnNext(Unit.Default);
			}
		}

		// Token: 0x060016A8 RID: 5800 RVA: 0x0006219C File Offset: 0x0006059C
		public IObservable<Unit> OnMouseUpAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.onMouseUp) == null)
			{
				result = (this.onMouseUp = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x060016A9 RID: 5801 RVA: 0x000621C4 File Offset: 0x000605C4
		private void OnMouseUpAsButton()
		{
			if (this.onMouseUpAsButton != null)
			{
				this.onMouseUpAsButton.OnNext(Unit.Default);
			}
		}

		// Token: 0x060016AA RID: 5802 RVA: 0x000621E4 File Offset: 0x000605E4
		public IObservable<Unit> OnMouseUpAsButtonAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.onMouseUpAsButton) == null)
			{
				result = (this.onMouseUpAsButton = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x060016AB RID: 5803 RVA: 0x0006220C File Offset: 0x0006060C
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onMouseDown != null)
			{
				this.onMouseDown.OnCompleted();
			}
			if (this.onMouseDrag != null)
			{
				this.onMouseDrag.OnCompleted();
			}
			if (this.onMouseEnter != null)
			{
				this.onMouseEnter.OnCompleted();
			}
			if (this.onMouseExit != null)
			{
				this.onMouseExit.OnCompleted();
			}
			if (this.onMouseOver != null)
			{
				this.onMouseOver.OnCompleted();
			}
			if (this.onMouseUp != null)
			{
				this.onMouseUp.OnCompleted();
			}
			if (this.onMouseUpAsButton != null)
			{
				this.onMouseUpAsButton.OnCompleted();
			}
		}

		// Token: 0x04000CB0 RID: 3248
		private Subject<Unit> onMouseDown;

		// Token: 0x04000CB1 RID: 3249
		private Subject<Unit> onMouseDrag;

		// Token: 0x04000CB2 RID: 3250
		private Subject<Unit> onMouseEnter;

		// Token: 0x04000CB3 RID: 3251
		private Subject<Unit> onMouseExit;

		// Token: 0x04000CB4 RID: 3252
		private Subject<Unit> onMouseOver;

		// Token: 0x04000CB5 RID: 3253
		private Subject<Unit> onMouseUp;

		// Token: 0x04000CB6 RID: 3254
		private Subject<Unit> onMouseUpAsButton;
	}
}
